<!DOCTYPE html>
<html>
<head>
    <title>javascript 回到顶部效果</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script type="text/javascript" src="script.js"></script>
</head>
<body>

     <div class="box">
         <img src="tb_bg.jpg" />
     </div>
     <a href="javascript:;"  id="btn" title="回到顶部"></a>
</body>
</html>